package com.example.demo.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Storage;
import com.example.demo.mapper.StorageMapper;
import com.example.demo.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StorageServiceImpl extends ServiceImpl<StorageMapper, Storage> implements StorageService {

    @Autowired
    private StorageMapper storageMapper;

    @Override
    public int storage(int count, String commodityCode) {
//        if (RandomUtil.randomBoolean()){
//            throw new RuntimeException("Storage Service this is a mock Exception");
//        }
        return storageMapper.storage(count,commodityCode);
    }
}
